<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="/WEB-INF/tld/importTag.tld" prefix="importTag"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<%@page import="com.yaodian100.core.common.utils.ServerValue"%>
<%@page import="org.apache.commons.lang.math.RandomUtils"%>
<%@page import="com.yaodian100.ec.category.entity.Category"%>
<%@page import="java.net.URLEncoder"%>
<c-rt:set var="frontContentHtmlPath" value='<%=ServerValue.getFrontContentHtmlPath()%>'/>
<c-rt:set var="frontHtmlPath" value='<%=ServerValue.getFrontApachePath()%>'/>
<script type="text/javascript" charset="UTF-8" src="/js/jquery.flash.js"></script>
<script type="text/javascript" charset="UTF-8" src="/js/jquery.random.js"></script>
<!-- javascript start -->
<script type="text/javascript">
	$().ready(function(){
		//default this menu is selected
		initCategory();

		//goldbn
		var goldbnNum = $.random(3);
		$("div.gold-bn > ul > li").eq(goldbnNum).attr("class",$("div.gold-bn > ul > li").eq(goldbnNum).attr("class")+"f");
		$("div.gold-bn > div").eq(goldbnNum).show();
		
		//random show maingold
		var maingoldNum = $.random(5);
		$("div.tab-area.main-gold > ul.tab-list > li").eq(maingoldNum).attr("class",$("div.tab-area.main-gold > ul.tab-list > li").eq(maingoldNum).attr("class")+"-f");
		$("#main-gold-" + (maingoldNum + 1)).show();

		//promotion top
		var topNum = $.random(5);
		//alert($("#top-tab-area"));
		$("#top-tab-area > ul.tab-list > li").eq(topNum).attr("class",$("#top-tab-area > ul.tab-list > li").eq(topNum).attr("class")+"-f");
		$("#top-tab-area-" + (topNum + 1)).show();	
		
		//promotion mid
		var midNum = $.random(5);
		$("#mid-tab-area > ul.tab-list > li").eq(midNum).attr("class",$("#mid-tab-area > ul.tab-list > li").eq(midNum).attr("class")+"-f");
		$("#mid-tab-area-" + (midNum + 1)).show();		
		
		//promotion btm
		var btmNum = $.random(5);
		$("#btm-tab-area > ul.tab-list > li").eq(btmNum).attr("class",$("#btm-tab-area > ul.tab-list > li").eq(btmNum).attr("class")+"-f");
		$("#btm-tab-area-" + (btmNum + 1)).show();
				
		$("#main").attr("class","${category.templateId}");

		//default tab3
		var tab3Num = $.random(3);
		$("div#tab3 > ul.tab-right > li").eq(tab3Num).attr("class",$("div#tab3 > ul.tab-right > li").eq(tab3Num).attr("class")+"f");
		$("div#tab3 > div").eq(tab3Num).show();

		//hotselect
		var selNum = $.random(3);
		$("div.hotsel-box").each(function(){
			$(this).hide();
		});
		$("div.hotsel-box").eq(selNum).show();
	});
</script>
<!-- javascript end -->
<!-- sidebar start -->
<div class="sidebar">
	<!-- menu start -->
	<importTag:static path="${frontContentHtmlPath}${category.id}/SIDEBAR.html"/>
	<!-- menu end -->
  <div class="ad-sky">
  	<script type="text/javascript">
			GA_googleFillSlot("yd100_${tempZId}_sidebar_right_image_01");
		</script>
  </div>
  <div class="lt-bn-end">
  	<script type="text/javascript">
			GA_googleFillSlot("yd100_${tempZId}_sidebar_right_image_02");
			GA_googleFillSlot("yd100_${tempZId}_sidebar_right_image_03");
		</script>
  </div>
</div>
<!-- sidebar end -->
<!-- content start -->
<div class="content">
	<div class="ad-leader">
		<script type="text/javascript">
			GA_googleFillSlot("yd100_${tempZId}_upper_image_01");
		</script>
	</div>
	<!-- tab area block adv start -->
	<div class="main-banner">
	<c-rt:set var="mainGoldNum"><%=RandomUtils.nextInt(3)+1%></c-rt:set>
	<c-rt:set var="mainGold"><importTag:static path="${frontContentHtmlPath}${category.id}/MAINGOLD_${mainGoldNum}.html"/></c-rt:set>
	<c-rt:choose>
		<c-rt:when test="${not empty mainGold}">${mainGold}</c-rt:when>
		<c-rt:otherwise>
			<importTag:static path="${frontContentHtmlPath}${category.id}/MAINGOLD_1.html"/>
		</c-rt:otherwise>
	</c-rt:choose>
	</div>
	<!-- tab area block adv end -->
	<div class="gold-right">
		<!-- 个人服务区 start -->
		<div class="my-service">
			<h6><strong>个人服务</strong></h6>
			<a class="my-s1" href="<%=ServerValue.getFrontContextPath()%>/tologin.do?redirect_url=<%=URLEncoder.encode("/member/myOrder/showOrders.do?t=T&p=1","UTF-8")%>" title="订单查询"><img src="/images/none.gif" /></a>
			<a class="my-s2" href="<%=ServerValue.getFrontContextPath()%>/tologin.do?redirect_url=<%=URLEncoder.encode("/member/myCollection/toproductc.do","UTF-8")%>" title="我的收藏"><img src="/images/none.gif" /></a>
			<a class="my-s3" href="<%=ServerValue.getFrontContextPath()%>/tologin.do?redirect_url=<%=URLEncoder.encode("/member/myyaodian.do","UTF-8")%>" title="我的帐户"><img src="/images/none.gif" /></a>			
		</div>
		<!-- 个人服务区 end -->
    <!-- 三切換廣告  start -->
    <div class="gold-bn">
	  	<ul>
	    	<li class="gdbn-1"></li>
	      <li class="gdbn-2"></li>
	      <li class="gdbn-3"></li>
	    </ul>
	    <div style="display:none;">
		    <script type="text/javascript">
			 		GA_googleFillSlot("yd100_${tempZId}_select_image_01");
				</script>
			</div>
	    <div style="display:none;">
		    <script type="text/javascript">
			 		GA_googleFillSlot("yd100_${tempZId}_select_image_02");
				</script>
			</div>
	    <div style="display:none;">
		    <script type="text/javascript">
			 		GA_googleFillSlot("yd100_${tempZId}_select_image_03");
				</script>
			</div>
  	</div>
    <!-- 三切換廣告  end -->
  </div>
  <!-- 熱搜精選  start -->
  <importTag:static path="${frontContentHtmlPath}${category.id}/HOTSELECT.html"/>
  <!-- 熱搜精選  end-->
  <!-- 腰帶廣告 start -->
  <div class="barmid">
  	<script type="text/javascript">
		 		GA_googleFillSlot("yd100_${tempZId}_twins_image_01");
		</script>
  </div>
  <div class="barmid barmid2">
  	<script type="text/javascript">
		 		GA_googleFillSlot("yd100_${tempZId}_twins_image_02");
		</script>
  </div>
  <!-- 腰帶廣告  end -->
  <!-- 中間  start -->
	<div class="centerarea">
		<!-- tab area top start -->
		<div class="tab-area" id="top-tab-area">
			<c-rt:set var="topNum"><%=RandomUtils.nextInt(5)+1%></c-rt:set>
			<c-rt:set var="topPromotion"><importTag:static path="${frontContentHtmlPath}${category.id}/PROMOTION_TOP_${topNum}.html"/></c-rt:set>
			<c-rt:choose>
				<c-rt:when test="${not empty topPromotion}">${topPromotion}</c-rt:when>
				<c-rt:otherwise>
					<importTag:static path="${frontContentHtmlPath}${category.id}/PROMOTION_TOP_1.html"/>
				</c-rt:otherwise>
			</c-rt:choose>
			<c-rt:set var="topBannerNum"><%=RandomUtils.nextInt(3)+1%></c-rt:set>
			<c-rt:set var="topBanner"><importTag:static path="${frontContentHtmlPath}${category.id}/BANNER_TOP_${topBannerNum}.html"/></c-rt:set>
			<c-rt:choose>
				<c-rt:when test="${not empty topBanner}">${topBanner}</c-rt:when>
				<c-rt:otherwise>
					<c-rt:set var="topBanner"><importTag:static path="${frontContentHtmlPath}${category.id}/BANNER_TOP_1.html"/></c-rt:set>
					<c-rt:if test="${not empty topBanner}">${topBanner}</c-rt:if>
				</c-rt:otherwise>
			</c-rt:choose>
		</div>
		<!-- tab area top end -->
		<!-- tab area mid start -->
		<div class="tab-area" id="mid-tab-area">
			<c-rt:set var="midNum"><%=RandomUtils.nextInt(5)+1%></c-rt:set>
			<c-rt:set var="midPromotion"><importTag:static path="${frontContentHtmlPath}${category.id}/PROMOTION_MID_${midNum}.html"/></c-rt:set>
			<c-rt:choose>
				<c-rt:when test="${not empty midPromotion}">${midPromotion}</c-rt:when>
				<c-rt:otherwise>
					<importTag:static path="${frontContentHtmlPath}${category.id}/PROMOTION_MID_1.html"/>
				</c-rt:otherwise>
			</c-rt:choose>
			<c-rt:set var="midBannerNum"><%=RandomUtils.nextInt(3)+1%></c-rt:set>
			<c-rt:set var="midBanner"><importTag:static path="${frontContentHtmlPath}${category.id}/BANNER_MID_${midBannerNum}.html"/></c-rt:set>			
			<c-rt:choose>
				<c-rt:when test="${not empty midBanner}">${midBanner}</c-rt:when>
				<c-rt:otherwise>
					<c-rt:set var="midBanner"><importTag:static path="${frontContentHtmlPath}${category.id}/BANNER_MID_1.html"/></c-rt:set>
					<c-rt:if test="${not empty midBanner}">${midBanner}</c-rt:if>
				</c-rt:otherwise>
			</c-rt:choose>
		</div>
		<!-- tab area mid end-->
		<!-- tab area btm start -->
		<div class="tab-area" id="btm-tab-area">
			<c-rt:set var="btmNum"><%=RandomUtils.nextInt(5)+1%></c-rt:set>
			<c-rt:set var="btmPromotion"><importTag:static path="${frontContentHtmlPath}${category.id}/PROMOTION_BTM_${btmNum}.html"/></c-rt:set>
			<c-rt:choose>
				<c-rt:when test="${not empty btmPromotion}">${btmPromotion}</c-rt:when>
				<c-rt:otherwise>
					<importTag:static path="${frontContentHtmlPath}${category.id}/PROMOTION_BTM_1.html"/>
				</c-rt:otherwise>
			</c-rt:choose>
			<c-rt:set var="btmBannerNum"><%=RandomUtils.nextInt(3)+1%></c-rt:set>
			<c-rt:set var="btmBanner"><importTag:static path="${frontContentHtmlPath}${category.id}/BANNER_BTM_${btmBannerNum}.html"/></c-rt:set>
			<c-rt:choose>
				<c-rt:when test="${not empty btmBanner}">${btmBanner}</c-rt:when>
				<c-rt:otherwise>
					<c-rt:set var="btmBanner"><importTag:static path="${frontContentHtmlPath}${category.id}/BANNER_BTM_1.html"/></c-rt:set>
					<c-rt:if test="${not empty btmBanner}">${btmBanner}</c-rt:if>
				</c-rt:otherwise>
			</c-rt:choose>
		</div>
		<!-- tab area btm end--> 
		<!-- good object area start -->
		<importTag:static path="${frontContentHtmlPath}${category.id}/GOODOBJECT.html"/>
		<!-- good object area end -->
		<img src="/images/none.gif" class="cf" />
  </div>
  <!-- 中间  end -->
  <!-- 右栏 -->
  <div class="right-bar">
	<!-- 品牌旗舰 start -->
	<div id="brandarea">
		<importTag:static path="${frontHtmlPath}/pages/BRAND/${category.id}.html"/>
	</div>
	<!-- 品牌旗舰  end-->
	<!-- 排行榜 start -->
	<c-rt:set var="rankingNum"><%=RandomUtils.nextInt(3)+1%></c-rt:set>
	<c-rt:set var="ranking"><importTag:static path="${frontContentHtmlPath}${category.id}/RANKINGLIST_${rankingNum}.html"/></c-rt:set>			
	<c-rt:choose>
		<c-rt:when test="${not empty ranking}">${ranking}</c-rt:when>
		<c-rt:otherwise>
			<c-rt:set var="ranking"><importTag:static path="${frontContentHtmlPath}${category.id}/RANKINGLIST_1.html"/></c-rt:set>
			<c-rt:if test="${not empty ranking}">${ranking}</c-rt:if>
		</c-rt:otherwise>
	</c-rt:choose>
	<!-- 排行榜 end -->
	<!-- 活动快讯  start -->
	<c-rt:set var="infoNum"><%=RandomUtils.nextInt(3)+1%></c-rt:set>
	<c-rt:set var="info"><importTag:static path="${frontContentHtmlPath}${category.id}/INFO_${infoNum}.html"/></c-rt:set>
	<c-rt:choose>
		<c-rt:when test="${not empty info}">${info}</c-rt:when>
		<c-rt:otherwise><importTag:static path="${frontContentHtmlPath}${category.id}/INFO_1.html"/></c-rt:otherwise>
	</c-rt:choose>
	<!-- 活动快讯  end -->
	<!-- 強力放送  start -->
	<c-rt:set var="broadCastNum"><%=RandomUtils.nextInt(3)+1%></c-rt:set>
	<c-rt:set var="broadCast"><importTag:static path="${frontContentHtmlPath}${category.id}/BROADCAST_${broadCastNum}.html"/></c-rt:set>
	<c-rt:choose>
		<c-rt:when test="${not empty broadCast}">${broadCast}</c-rt:when>
		<c-rt:otherwise><importTag:static path="${frontContentHtmlPath}${category.id}/BROADCAST_1.html"/></c-rt:otherwise>
	</c-rt:choose>
	<!-- 强力放送  end -->
	<!-- 右欄廣告腳 -->
  <div class="rt-bn-end">
  	<script type="text/javascript">
			GA_googleFillSlot("yd100_${tempZId}_lr_image_01");
		</script>
  </div>
  <!-- 右欄廣告腳 -->
  </div>
  <!-- 右栏 -->
</div>